package com.aiyige.share.model;

import com.aiyige.model.User;
import com.aiyige.model.moment.entity.Moment;

public class ShareEntity {
    public static final int SHARE_TYPE_MOMENT = 1;
    public static final int SHARE_TYPE_USER = 2;
    public static final int SHARE_TYPE_LINK = 3;
    Moment moment;
    User user;
    String link;
    int shareType;
    ShareContactItem contact;


    public ShareEntity() {
    }

    private ShareEntity(Builder builder) {
        setMoment(builder.moment);
        setUser(builder.user);
        setLink(builder.link);
        setShareType(builder.shareType);
        setContact(builder.contact);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public Moment getMoment() {
        return moment;
    }

    public void setMoment(Moment moment) {
        this.moment = moment;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public int getShareType() {
        return shareType;
    }

    public void setShareType(int shareType) {
        this.shareType = shareType;
    }

    public ShareContactItem getContact() {
        return contact;
    }

    public void setContact(ShareContactItem contact) {
        this.contact = contact;
    }

    public static final class Builder {
        private Moment moment;
        private User user;
        private String link;
        private int shareType;
        private ShareContactItem contact;

        private Builder() {
            moment = null;
            user = null;
            contact = null;
            link = null;
        }

        public Builder moment(Moment val) {
            moment = val;
            return this;
        }

        public Builder user(User val) {
            user = val;
            return this;
        }

        public Builder link(String val) {
            link = val;
            return this;
        }

        public Builder shareType(int val) {
            shareType = val;
            return this;
        }

        public Builder contact(ShareContactItem val) {
            contact = val;
            return this;
        }

        public ShareEntity build() {
            return new ShareEntity(this);
        }
    }
}
